import { lazy } from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex, EmptyIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";
import { ADMIN_AUTH_KEY, SUPER_ADMIN_AUTH_KEY } from "@conf";
import {
	HomeOutlined,
	UserOutlined,
	FolderOutlined,
	FileTextOutlined,
	FileAddOutlined,
	FileImageOutlined,
} from "@ant-design/icons";
// 首页模块

const MainRouter = [
	{
		path: "home",
		element: lazyLoad(lazy(() => import("@/views/majom/home/index"))),
		meta: {
			title: "首页",
			icon: <HomeOutlined />,
		},
	},
	{
		path: "theuser",
		element: lazyLoad(lazy(() => import("@/views/majom/theuser/index"))),
		meta: {
			title: "用户列表",
			icon: <UserOutlined />,
		},
	},
	{
		path: "theuser/adduser",
		element: lazyLoad(lazy(() => import("@/views/majom/theuser/adduser"))),
		meta: {
			title: "增加使用者",
			hidden: true,
		},
	},
	{
		path: "deck",
		element: <EmptyIndex />,

		meta: {
			title: "牌组管理",
			icon: <FolderOutlined />,
		},
		children: [
			{
				path: "addcards",
				element: lazyLoad(lazy(() => import("@/views/majom/deck/addcards"))),
				meta: {
					title: "添加牌型",
					icon: <FileAddOutlined />,
					hidden: true,
				},
			},
			{
				path: "cardslist",
				element: lazyLoad(lazy(() => import("@/views/majom/deck/cardslist"))),
				meta: {
					title: "牌型列表",
					icon: <FileTextOutlined />,
				},
			},
			{
				path: "decklist",
				element: lazyLoad(lazy(() => import("@/views/majom/deck/decklist"))),
				meta: {
					title: "牌组列表",
					icon: <FileTextOutlined />,
				},
			},
			// {
			// 	path: "deckedit/:id",
			// 	element: lazyLoad(lazy(() => import("@/views/majom/deck/deckedit"))),
			// 	meta: {
			// 		title: "编辑牌组",
			// 		icon: <FileAddOutlined />,
			// 		hidden: true,
			// 	},
			// },
		],
	},
	{
		path: "bglist",
		element: lazyLoad(lazy(() => import("@/views/majom/bglist"))),
		meta: {
			title: "背景素材",
			icon: <FileImageOutlined />,
		},
	},
];

const homeRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		path: "/majom",
		children: MainRouter,
		meta: {
			title: "管理员",
		},
	},
];

export default homeRouter;
